package com.tanhua.admin.api;

import com.tanhua.admin.mapper.FreezeMapper;
import com.tanhua.dubbo.api.FreezeApi;
import com.tanhua.model.db.Freeze;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

/**
 * @ClassName FreezeApiImpl
 * @Description TODO
 * @date 2021/11/1 17:55
 * @Version 1.0
 */
@DubboService
public class FreezeApiImpl implements FreezeApi {
    @Autowired
    private FreezeMapper freezeMapper;

    @Override
    public Freeze selectByUid(Long uid) {
        return freezeMapper.selectByUid(uid);
    }

    @Override
    public Long selectFreezeTimeDifference(Date currentDate, Date unfreezeTime) {
        return freezeMapper.selectFreezeTimeDifference(currentDate,unfreezeTime);
    }

    @Override
    public void updateById(Freeze freeze) {
        freezeMapper.updateById(freeze);
    }
}
